//
//  sendGiftSend.m
//  tcpoctest
//
//  Created by gump on 5/21/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

#import "sendGiftSend.h"

@implementation sendGiftSend

-(void)SendGiftSendGift:(NSString *)strgiftid
               withMail:(NSString *)mail
              withCount:(int)icount
{
    //发送 26char(1),3char(1),礼物ID长度char(1),
    //礼物idchar(x),收礼人名称长度char(1)，,
    //收礼人名称char(x),int数量
    
    if (![self CheckLogin]) {
        return;
    }
    
    int l = CHAR_PL * 4 + INT_PL * 2 + [strgiftid length] + [mail length];
    
    [self initDataByLength:l];
    
    [sb WriteChar:[strgiftid length]];
    [sb WriteString:strgiftid withLength:[strgiftid length]];
    
    [sb WriteChar:[mail length]];
    [sb WriteString:mail withLength:[mail length]];
    
    [sb WriteInt:icount withNTT:NTT_SMALL2BIG];
    
    [self Package];
}

@end
